package com.object.oriented.exam.system8.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.object.oriented.exam.system8.entity.Question;
import com.object.oriented.exam.system8.service.ErrorService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ztz
 * @date 2023-06-20
 */
@RestController
@RequestMapping("/error")
public class ErrorController {

    @Resource
    ErrorService errorService;

    /**
     * 分页获取学生错题记录
     * @param studentId
     * @param current
     * @param size
     * @return
     */
    @GetMapping("/{studentId}/{current}/{size}")
    public Page<Question> getErrorProblem(@PathVariable Long studentId, @PathVariable Long current, @PathVariable Long size){
        return errorService.getErrorProblem(studentId,current,size);
    }

}
